/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __MAIN_WINDOW_H__
#define __MAIN_WINDOW_H__

#include "BuilderPrerequisites.h"

#include "SceneWindow.h"
#include "ProjectDialog.h"
#include "FractalTerrainGenerateDialog.h"
#include "VoronoiDiagramDialog.h"

namespace PQBuilder
{
	//Root window of the application
	class MainWindow : 
		public QMainWindow
	{
		Q_OBJECT
	public:
		static const int PROPERTY_DOCK_WIDTH=220;
		static const int ASSETS_DOCK_WIDTH=220;

		static const QString HIERACHY_WIDGET_NAME;
		static const QString OBJECT_CREATE_WIDGET_NAME;
		static const QString ASSET_WIDGET_NAME;
		
	public:
		MainWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
		~MainWindow();
		
		void createDefaultUI();//load ui when project created or opened

	public slots:
		void selectCreateDialog();
		void selectOpenDialog();
		void saveProject();
		void generateFractalTerrain();
		void generateVoronoiDiagram();
	private:
		void createMenus();

		void createPropertyDock();
		void createAssetsDock();
		void createObjectDock();
		void createHierachyDock();

		void createSceneWindow();//main
	private:
		SceneWindow *_builderWindow;
		ProjectDialog* _projectDialog;
		FractalTerrainGenerateDialog* _fractalTerrainDialog;
		VoronoiDiagramDialog* _voronoiDiagramDialog;

		//left docks
		QDockWidget *_dockHierachy;
		QDockWidget *_dockAssets;
		QDockWidget *_dockObject;

		//right docks
		QDockWidget *_dockProperty;

		
	};
}

#endif
